<template>
    <div>
        <el-form :inline="true" class="demo-form-inline">
            <el-form-item label="建议采购价">
                <el-input v-model="buyPrice"></el-input>
            </el-form-item>
            <el-form-item label="建议销售价">
                <el-input v-model="sellPrice" placeholder="必填"></el-input>
            </el-form-item>
            <el-form-item label="厂商">
                <el-input v-model="goodsfactory"></el-input>
            </el-form-item>
<!--            <el-form-item label="商品id">-->
<!--                <el-input v-model="goodsid" ></el-input>-->
<!--            </el-form-item>-->
            <el-form-item label="商品图片">
                <el-input v-model="goodsimgpath"></el-input>
            </el-form-item>
<!--            <el-form-item label="商品供应商">-->
<!--                <el-input v-model="goodsprovider"></el-input>-->
<!--            </el-form-item>-->
            <el-form-item label="商品名称">
                <el-input v-model="goodsname" placeholder="必填"></el-input>
            </el-form-item>
            <el-form-item label="数量">
                <el-input v-model="num" placeholder="必填"></el-input>
            </el-form-item>
            <el-form-item label="供应商id">
                <el-input v-model="providerId" placeholder="必填"></el-input>
            </el-form-item>
            <el-form-item label="商品类别">
                <el-input v-model="goodstype"></el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="add" @click="add">添加预处理</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    export default {
        name: "ShowAdd2",

        data() {
            return {
                buyPrice:'',
                sellPrice:'',
                goodsfactory:'',
                goodsid: '',
                num: '',
                goodsimgpath: '',
                goodsname: '',
                goodsprovider:'',
                providerId:'',
                goodstype:'',


            }
        },
        methods: {

            add() {
                let url = "api/buy/addNumber?goodsadvicebuyprice="+this.buyPrice
                    +"&goodsadvicesellprice="+this.sellPrice+"" +
                    "&goodsfactory="+this.goodsfactory+
                    "&goodsid="+this.goodsid+"" +
                    "&goodsimgpath="+this.goodsimgpath+"&goodsname="+this.goodsname+"" +
                    "&goodsprovider="+this.goodsprovider+"&goodstype="+this.goodstype+"" +
                    "&num="+this.num+"&providerId="+this.providerId

            this.$axios.get(url).then(r => {
                console.log(r.data)
                if (r.data == true) {
                    alert("添加完成")
                    this.$router.push("PurchaseView")
                }
            })
        }
    }
    }
</script>

<style scoped>

</style>